<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="common/include :: header('平台用户列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="customer-form">
                <div class="select-list">
                    <ul>
                        <li>
                            关键字：<input type="text" name="keyword" placeholder="模糊查询昵称"/>
                        </li>
                        <li>
                            手机号码：<input type="text" name="mobile"/>
                        </li>
                        <li>
                            性别：
                            <select name="gender" th:with="items=${@dict.getType('sys_user_sex')}">
                                <option value="">所有</option>
                                <option th:each="item : ${items}" th:text="${item.label}"
                                        th:value="${item.value}"></option>
                            </select>
                        </li>
                        <li class="select-time">
                            <label>注册时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="common/include :: footer"/>
<script th:inline="javascript">
    var sexData = [[${@dict.getType('sys_user_sex')}]];
    var prefix = ctx + "/business/shopUser";
    $(function () {
        var options = {
            url: prefix + "/query",
            uniqueId: 'id',
            modalName: "用户",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'username',
                    title: '用户名'
                },
                {
                    field: 'nickname',
                    title: '昵称'
                },
                {
                    field: 'mobile',
                    title: '手机号码'
                },
                {
                    field: 'gender',
                    title: '性别',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(sexData, value);
                    }
                },
                {
                    field: 'birthday',
                    title: '生日'
                },
                {
                    field: 'registerTime',
                    title: '注册时间'
                },
                {
                    field: 'registerIp',
                    title: '注册IP'
                },
                {
                    field: 'lastLoginTime',
                    title: '最后登录时间'
                },
                {
                    field: 'lastLoginIp',
                    title: '最后登录IP'
                },
                {
                    field: 'weixinOpenId',
                    title: '微信OpenId'
                },
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>